package com.xigua.JucOfBeautiful.chapterOne.interrup1_7;

/**
 * @author LiRongHua
 * @Title: ${file_name}
 * @Package ${package_name}
 * @Description: ${todo}
 * @date 2022/1/2315:52
 */
public class InterrupTest3 {

    public static void main(String[] args) throws InterruptedException {
        Thread thread = new Thread(()->{
            while (!Thread.currentThread().interrupted()){

            }
            System.out.println("thread is isInterrupted:"+Thread.currentThread().isInterrupted());
        });

        thread.start();
        Thread.sleep(10000);
        thread.interrupt();
        thread.join();
        System.out.println("main is over");

    }

}
